﻿using System;
using System.Collections.ObjectModel;

namespace Authorit.API.Utilities
{
	/// <summary>
	/// The <see cref="ReleaseStatesCollection"/> class stores a collection of instances of the <see cref="Authorit.API.Dto.ReleaseState"/> class.
	/// </summary>
	public class ReleaseStatesCollection : KeyedCollection<int, Dto.ReleaseState>
	{
		/// <summary>
		/// The <see cref="ReleaseStatesCollection()"/> constructor initializes a new instance of the <see cref="ReleaseStatesCollection"/> class.
		/// </summary>
		public ReleaseStatesCollection()
			: base()
		{
		}

		/// <summary>
		/// The <see cref="GetKeyForItem(Authorit.API.Dto.ReleaseState)"/> method gets the key for the specified instance of the <see cref="Authorit.API.Dto.ReleaseState"/> class.
		/// </summary>
		/// <param name="item">The instance of the <see cref="Authorit.API.Dto.ReleaseState"/> class for which to find the key</param>
		/// <returns>The key for the specified instance of the <see cref="Authorit.API.Dto.ReleaseState"/> class </returns>
		protected override int GetKeyForItem(Dto.ReleaseState item)
		{
			return item.ReleaseStateId;
		}
	}
}